package com.bootcamp.javase2.threads;

import java.io.IOException;

/**
 * @program: ThreadCode
 * @description:
 * @author: Keyu Li
 * @create: 2021-09-13 21:38
 **/

public class LiuweOrder {

    public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {

        MyThread t1 = new MyThread("t1");
        MyThread t2 = new MyThread("t2");
        MyThread t3 = new MyThread("t3");
        t1.start();
        t1.join();
        t2.start();
        t2.join();
        t3.start();
    }

}

class MyThread extends Thread {

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(getName() + "线程执行----" + i);
        }
    }
}
